package com.manager.common.tcp.encode.impl;

import com.manager.common.tcp.constant.TcpDataType;
import com.manager.common.tcp.encode.BaseEncode;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

public class HeartEncode extends BaseEncode {

    @Override
    public byte[] encode(String data) throws Exception{
        ByteBuf buf = this.head(TcpDataType.HEARTBEAT);
        buf.writeInt(0);
        byte[] result = new byte[buf.readableBytes()];
        buf.readBytes(result);
        return result;
    }
}
